"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
var electron_1 = require("electron");
var validChannels = ["HelloWorld"];
electron_1.contextBridge.exposeInMainWorld("electronAPI", {
    send: function (channel) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        if (validChannels.includes(channel))
            electron_1.ipcRenderer.send(channel, args);
    },
    receive: function (channel, callback) {
        if (validChannels.includes(channel))
            electron_1.ipcRenderer.on(channel, function (event) {
                var args = [];
                for (var _i = 1; _i < arguments.length; _i++) {
                    args[_i - 1] = arguments[_i];
                }
                return callback.apply(void 0, __spreadArray([event], args, false));
            });
    },
    removeAllListeners: function (channel) {
        if (validChannels.includes(channel))
            electron_1.ipcRenderer.removeAllListeners(channel);
    },
    callHello: function () { return electron_1.ipcRenderer.invoke("callHello"); },
});
